<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script type="module">
import {TestStruct_Deserialize} from '/gen/mojo/public/interfaces/bindings/tests/deserializer.test-mojom.m.js';

test(() => {
  const data = new Uint32Array([
    24,       // header (size)
    0,        // header (version)
    8899,     // v1
    9988,     // v2
    7777, 0,  // v3
  ]);
  const dataview = new DataView(data.buffer);
  const s = TestStruct_Deserialize(dataview);
  assert_equals(s.v1, 8899);
  assert_equals(s.v2, 9988);
  assert_equals(s.v3, 7777n);
}, 'deserializers are generated and exported as requested');
</script>
